<?php

/**
 * Cadconcessao form base class.
 *
 * @method Cadconcessao getObject() Returns the current form's model object
 *
 * @package    SCBE
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseCadconcessaoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'idconcessao'      => new sfWidgetFormInputHidden(),
      'idpedido'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Cadpedido'), 'add_empty' => false)),
      'dataconcessao'    => new sfWidgetFormDate(),
      'envioudocumentos' => new sfWidgetFormInputText(),
      'trechoviagem'     => new sfWidgetFormInputText(),
      'numerobanco'      => new sfWidgetFormInputText(),
      'nomebanco'        => new sfWidgetFormInputText(),
      'nomeagencia'      => new sfWidgetFormInputText(),
      'contacorrente'    => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'idconcessao'      => new sfValidatorChoice(array('choices' => array($this->getObject()->get('idconcessao')), 'empty_value' => $this->getObject()->get('idconcessao'), 'required' => false)),
      'idpedido'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Cadpedido'))),
      'dataconcessao'    => new sfValidatorDate(array('required' => false)),
      'envioudocumentos' => new sfValidatorInteger(array('required' => false)),
      'trechoviagem'     => new sfValidatorString(array('max_length' => 45, 'required' => false)),
      'numerobanco'      => new sfValidatorString(array('max_length' => 4, 'required' => false)),
      'nomebanco'        => new sfValidatorString(array('max_length' => 45, 'required' => false)),
      'nomeagencia'      => new sfValidatorString(array('max_length' => 45, 'required' => false)),
      'contacorrente'    => new sfValidatorString(array('max_length' => 20, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('cadconcessao[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Cadconcessao';
  }

}
